package com.netty.demo.server.netty;

import com.netty.demo.server.netty.udp.NettyUdpServer;
import com.netty.demo.server.netty.websocket.NettyWebsocketServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * netty服务启动类
 *
 * @author yxl 余秀良
 * @version 1.0
 * <p>date: 2019年09月07日  下午3:59 </p>
 * <p>address: 四川成都 </p>
 */
@Component
public class NettyServerStart implements CommandLineRunner {
    @Resource
    private NettyUdpServer server;
    @Resource
    private NettyWebsocketServer nettyWebsocketServer;

    //@Resource
    //private NettyTcpServer tcpServer;
    @Override
    public void run(String... args) throws Exception {
        server.start();
        //tcpServer.start();
        nettyWebsocketServer.start();
    }
}
